<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ include file="/WEB-INF/jsp/commons/includes.jsp"%>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> -->
    <title>Document</title>
    <link rel="stylesheet" href="${ctx}/front/css/index.css">
    <style>
        .load-msg{
            position: absolute;
            left:50%;
            top:50%;
            font-size:40px;
            color:#FFFFFF;
            -webkit-transform: translate3D(-50%,-50%,0);
            transform: translate3D(-50%,-50%,0);
        }

        body {
            background-size: cover;
            background-image: url(${ctx}/front/img/bg.png);
        }
    </style>
</head>
<body>
<input type="hidden" id="ctxContent" value="${ctx}" />
<input type="hidden" id="classId" value="${classId}" />
<input type="hidden" id="originalId" value="${originalId}" />
<span class="load-msg" id="load-msg">下载中......</span>
<canvas width="1024" height="768" class="game-bg" id="gameView"></canvas>
</body>
<script src="${ctx}/front/js/common/flexible.js"></script>
<script src="${ctx}/front/js/vendor/createjs-2015.11.26.min.js"></script>
<script src="${ctx}/front/js/vendor/tweenjs-0.6.2.min.js"></script>
<script src="${ctx}/front/js/vendor/easeljs-0.8.2.min.js"></script>

<script src="${ctx}/front/js/common/canvas.js"></script>
<script src="${ctx}/front/js/vendor/jquery-2.1.1.min.js"></script>

<script src="${ctx}/front/js/common/CFormatText.js"></script>
<script src="${ctx}/front/js/common/settings.js"></script>
<script src="${ctx}/front/js/common/ctl_utils.js"></script>
<script src="${ctx}/front/js/common/CToggle.js"></script>
<script src="${ctx}/front/js/middle/CMain.js"></script>
<script src="${ctx}/front/js/middle/CGame.js"></script>

<script type="text/javascript" src="http://injection/www/cordova.js"></script>
<script type="text/javascript" src="http://injection/www/js/Launcher.js"></script>
<script type="text/javascript" charset="utf-8">
    var sucopen = function(data) {
        console.log("open ok");
    };
    var erropen = function(errMsg) {
        console.log("open err");
    };
    // Default handlers
    var successCallback = function(data) {
        console.log("ok!");
        // if calling canLaunch() with getAppList:true, data will contain an array named "appList" with the package names of applications that can handle the uri specified.
        window.plugins.launcher.launch(
                {packageName:'org.cocos2d.edu'},
                sucopen,
                erropen
        );
    };
    var errorCallback = function(errMsg) {
        alert("Error! " + errMsg);
    }

    var game4SuccessCallback = function(data) {
        console.log("ok!");
        // if calling canLaunch() with getAppList:true, data will contain an array named "appList" with the package names of applications that can handle the uri specified.
        window.plugins.launcher.launch(
                {packageName:'org.cocos2d.game4'},
                sucopen,
                erropen
        );
    };

    function openApp() {
        window.plugins.launcher.canLaunch({packageName:'org.cocos2d.edu'}, successCallback, errorCallback);
    }

    function openApp4() {
        window.plugins.launcher.canLaunch({packageName:'org.cocos2d.game4'}, game4SuccessCallback, errorCallback);
    }
</script>

<script>
    $(document).ready(function () {

        var oDataInfo = {};
        var oMain = new CMain(oDataInfo);
    });

</script>

</html>